import React from 'react'
import { WapHomeO, AppsO, CartO, UserCircleO } from '@react-vant/icons';

const Home = React.lazy(() => import('../views/home'))
const Car = React.lazy(() => import('../views/car'))
const Classify = React.lazy(() => import('../views/classify'))
const Detail = React.lazy(() => import('../views/detail'))
const Login = React.lazy(() => import('../views/login'))
const User = React.lazy(() => import('../views/user'))
const Order = React.lazy(() => import('../views/order'))
const MainLayout = React.lazy(() => import('../layout/mainLayout'))
const Search = React.lazy(() => import('../views/search'))


export const children_routers = [{
  path: '/',
  element: <Home></Home>,
  title: '首页',
  icon: <WapHomeO  />
},{
  path: '/classify',
  element: <Classify></Classify>,
  title: '分类',
  icon: <AppsO  />
},{
  path: '/car',
  element: <Car></Car>,
  title: '购物车',
  icon: <CartO  />
},{
  path: '/user',
  element: <User></User>,
  title: '我的',
  icon: <UserCircleO  />
}]

export const routes = [{
  path: '/',
  element: <MainLayout></MainLayout>,
  children: children_routers
},{
  path: '/login',
  element: <Login></Login>
},{
  path: '/detail/:id',
  element: <Detail></Detail>
}, {
  path: '/order',
  element: <Order></Order>
},{
  path: '/search',
  element: <Search></Search>
}]